<?php

class User extends Item {
	
	public function getUrl() {
		return 'profil/' . $this['username'] . '.html';
	}
	
	public function getMessageUrl() {
		return 'spravy/' . $this['username'] . '.html';
	}
	
	public function getShowName() {
		$name = trim($this['first_name'] . ' ' . $this['last_name']);
		
		if ($name) {
			$name .= ' (' . $this['username'] . ')';
		} else {
			$name .= $this['username'];
		}
		
		return $name;
	}
	
	public function getFullName() {
		$fullName = trim($this['first_name'] . ' ' . $this['last_name']);
		if (!$fullName) {
			$fullName = $this['username'];
		}
		return $fullName;
	}
}

?>